/**
 * \brief  Server-side de-marshaller of tsk session interface
 * \author Christian Helmuth
 * \date   2006-07-12
 */

/*
 * Copyright (C) 2006-2009 Christian Helmuth
 * Genode Labs, Feske & Helmuth Systementwicklung GbR
 *
 * This file is part of the Genode OS framework, which is distributed
 * under the terms of the GNU General Public License version 2.
 */

#ifndef _INCLUDE__PD_SESSION__SERVER_H_
#define _INCLUDE__PD_SESSION__SERVER_H_

#include <base/server.h>
#include <pd_session/pd_session.h>
#include <base/printf.h>

namespace Genode {

	class Pd_session_server : public Server_object, public Pd_session
	{
		public:

			int dispatch(int op, Ipc_istream &is, Ipc_ostream &os)
			{
				switch (op) {

				case BIND_THREAD:
					{
						Thread_capability thread;
						is >> thread;
						return bind_thread(thread);
					}

				default:
					PWRN("unknown opcode %d", op);
					return -1;
				}
			}
	};
}

#endif /* _INCLUDE__PD_SESSION__SERVER_H_ */
